package com.entiy;

import java.sql.Date;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

public class StudenttableEntity {
    private String number;
    private String name;
    private byte sex;
    private Date birthday;
    private int specialtyId;
    private Integer totalcredits;
    private String remarks;
    private byte[] photo;
    private MajortableEntity majortableEntity;
    private Set course = new HashSet();

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public byte getSex() {
        return sex;
    }

    public void setSex(byte sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public int getSpecialtyId() {
        return specialtyId;
    }

    public void setSpecialtyId(int specialtyId) {
        this.specialtyId = specialtyId;
    }

    public Integer getTotalcredits() {
        return totalcredits;
    }

    public void setTotalcredits(Integer totalcredits) {
        this.totalcredits = totalcredits;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public byte[] getPhoto() {
        return photo;
    }

    public void setPhoto(byte[] photo) {
        this.photo = photo;
    }

    public Set getCourse() {
        return course;
    }

    public void setCourse(Set course) {
        this.course = course;
    }

    public MajortableEntity getMajorDetail() {
        return majortableEntity;
    }

    public void setMajorDetail(MajortableEntity majorDetail) {
        this.majortableEntity = majorDetail;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        StudenttableEntity that = (StudenttableEntity) o;
        return sex == that.sex && specialtyId == that.specialtyId && Objects.equals(number, that.number) && Objects.equals(name, that.name) && Objects.equals(birthday, that.birthday) && Objects.equals(totalcredits, that.totalcredits) && Objects.equals(remarks, that.remarks) && Arrays.equals(photo, that.photo);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(number, name, sex, birthday, specialtyId, totalcredits, remarks);
        result = 31 * result + Arrays.hashCode(photo);
        return result;
    }
}
